﻿using RayDen.Library.Core;
using RayDen.Library.Core.Primitives;

namespace RayDen.Library.Components.Volume {
    public abstract class VolumeRegion {
        public abstract AABB WorldBound();
        public abstract bool IntersectP(RayInfo ray, out float t0, out float t1);
        public abstract RgbSpectrum sigma_a(ref Point p, ref Vector d, float time);
        public abstract RgbSpectrum sigma_s(ref Point p, ref Vector d, float time);
        public abstract RgbSpectrum Lve(ref Point p, ref Vector d, float time);
        public abstract float p(ref Point p, ref Vector d, ref Vector d1, float time);
        public virtual RgbSpectrum sigma_t(ref Point p, ref Vector wo, float time)
        {
            return sigma_a(ref p, ref wo, time) + sigma_s(ref p, ref wo, time);
        }

        public abstract RgbSpectrum tau(RayInfo ray, float step = 1f, float offset = 0.5f);
    }
}